import request from '@/utils/request'

const {
    get: $get,
    post: $post,
    delete: $delete,
    download: $download
} = request

// 查询事故案例全部
export const riskAccidentCasesList = data => {
    return $get('/risk/riskAccidentCases/list', data)
}

// 查询事故案例列表
export const riskAccidentCasesPage = data => {
    return $get('/risk/riskAccidentCases/page', data)
}

// 新增事故案例
export const riskAccidentCasesAdd = data => {
    return $post('/risk/riskAccidentCases/add', data)
}

// 查询事故案例详情
export const riskAccidentCasesDetail = id => {
    return $get('/risk/riskAccidentCases/detail/'+ id)
}

// 更新事故案例
export const riskAccidentCasesUpdate = data => {
    return $post('/risk/riskAccidentCases/update', data)
}

// 删除事故案例
export const riskAccidentCasesDelete = id => {
    return $post('/risk/riskAccidentCases/delete/'+ id)
}

// 导出事故案例
export const riskAccidentCasesExport = (data,fileName) => {
    return $download('/risk/riskAccidentCases/export',data, fileName)
}

export const riskAccidentCasesExportDL = (data,fileName) => {
  return $download('/risk/riskAccidentCases/exportDL',data, fileName)
}

// 事故趋势统计
export const accidentTrend = data =>{
  return $get('/risk/riskAccidentCases/accidentTrend',data)
}

// 事故排名
export const accidentRank = data =>{
  return $get('/risk/riskAccidentCases/accidentRank',data)
}

// 事故类型分类
export const accidentTypes = data =>{
  return $get('/risk/riskAccidentCases/accidentTypes',data)
}

// 事故区域分布
export const accidentDistribution = data =>{
  return $get('/risk/riskAccidentCases/accidentDistribution',data)
}

// 事故原因
export const accidentReason = data =>{
  return $get('/risk/riskAccidentCases/accidentReason',data)
}

// 事故案例申请
export const riskAccidentCasesApplySetCase = id => {
  return $post('/risk/riskAccidentCases/applySetCase/'+ id)
}

